package vn.axonactive;

import java.util.List;

import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

@Stateless
public class BookDao {
	
	@PersistenceContext
	private EntityManager em;

	public List<Book> getBooks() {
		return em.createQuery("select b from Book b",Book.class).getResultList();
	}

	public void saveBook(Book book) {
		em.persist(book);
		
	}
}
